import http from "../../utils/request"
import qs from 'qs'

//请求递归后的菜单数据
export const listMenuTree = (params) =>{
  //console.log(qs.stringify(params))
  return http.post('/menu/listMenuTree',qs.stringify(params));
}
//带条件的递归查询
export const listQueryMenuTree = (params) =>{
  return http.post('/menu/listQueryMenuTree',qs.stringify(params));
}
//添加或修改
export const saveOrUpdateMenu = (data) =>{
  return http.post('/menu/saveOrUpdateMenu',qs.stringify(data));
}
//根据id查找一条
export const editMenu = (data) =>{
  return http.post('/menu/editMenu/'+data.menuId);
}
//根据id删除一条
export const delMenu = (data) =>{
  return http.get('/menu/delMenu/'+data.menuId);
}

export default {
  listMenuTree,
  listQueryMenuTree,
  saveOrUpdateMenu,
  editMenu,
  delMenu
}
